#!/bin/bash
cd /etc/pam.d
for i in *
do
  if [ "$i" != "passwd" ]
  then
     x=`grep -q ^"auth    required    /lib/security/pam_hsc.so" $i`
     if [ $? -eq 1 ]
     then
        echo "auth    required    /lib/security/pam_hsc.so" >> $i
     fi
  fi
done
cd /
grep -q "HMC_BASH_PROFILE_PROCESSING" /etc/profile
if [ $? -ne 0 ]
then
   if [ -f /opt/hsc/data/ssh/hmcbashprofile ]
   then
      mv /etc/profile /etc/profile.tmp
      cp /opt/hsc/data/ssh/hmcbashprofile /etc/profile
      cat /etc/profile.tmp >> /etc/profile
   fi
fi
x=`grep "^*backarrowKeyIsErase:" /usr/X11R6/lib/X11/app-defaults/XTerm 2>/dev/null`
if [ $? -eq 0 ]
then
   y=`echo $x | cut -d' ' -f2`
   if [ "$y" = "true" ]
   then
      sed -e 's/^*backarrowKeyIsErase:[ \t]true/*backarrowKeyIsErase:\tfalse/g' /usr/X11R6/lib/X11/app-defaults/XTerm > /tmp/_saved_XTerm
      if [ $? -eq 0 ]
      then
	mv /tmp/_saved_XTerm /usr/X11R6/lib/X11/app-defaults/XTerm
      fi
    fi
else
   echo "*backarrowKeyIsErase:\tfalse" >> /usr/X11R6/lib/X11/app-defaults/XTerm
fi
